#include "RBTree.h"

namespace fuh{
    template<class K,class Compare = DefaultCmp<K>>
    class set{

        struct SetKey
        {
            const K& operator()(const K& k) const
            {
                return k;
            }
        };  

        RBTree<K,K,SetKey> m_tree;
        public:
        typedef typename RBTree<const K,K,SetKey,Compare>::const_iterator iterator;//这里要加typename，告诉编译器，这是个类型，不是变量，否则编译器搞不清楚
        typedef typename RBTree<const K,K,SetKey,Compare>::const_iterator const_iterator;//这里要加typename，告诉编译器，这是个类型，不是变量，否则编译器搞不清楚
        iterator begin() const
        { 
            return m_tree.begin();
        }
        iterator end() const
        { 
            return m_tree.end();
        }
        const_iterator cbegin() const
        { 
            return m_tree.begin();
        }
        const_iterator cend() const
        { 
            return m_tree.end();
        }
        pair<const_iterator,bool> insert(const K& k)
        {
            return m_tree.insert(k);
        }
    };
};